/*
 *  harry/test/clean.c
 *
 *  Harry Wei <harryxiyou@gmail.com> 2011 (C)
 */

#include <glib.h>
#include <stdint.h>
#include <stdlib.h>

#include "hlfs.h"
#include "clean.h"

#define LEN		(1024llu * 1024llu * 68llu)
#define COUNT		(2llu)

int main(int argc, char **argv)
{
	uint64_t i = 0llu;
	uint64_t ret1 = 0llu;
	uint64_t ram = LEN;
	static char ch[LEN];
	const char *uri = "local:///tmp/testenv";
	const char *fs_name = "testfs";
	struct hlfs_ctrl *ctrl = init_hlfs(uri, fs_name);

	g_assert(ctrl != NULL);
	int ret = hlfs_open(ctrl, 1);
	g_assert(0 == ret);
	for (i = 0; i < LEN; i++) {
		ch[i] = 0;
	}
	for (i = 0; i < COUNT; i++) {
		api_write_rewrite(ctrl, ch, LEN, 0);	
//		ret1 = hlfs_write(ctrl, ch, LEN, 0);
//		g_assert(ret1 == LEN);
	}
	su_check_task(ctrl);
	api_write_rewrite(ctrl, ch, 0, 0);
	return 0;
}
